package com.job.ming.zuoye0705;

/**
 * @author Yangmingyu
 * @version 1.0
 * @since 2022-07-06 13:56:26
 */
public class Sanjiaojvzhen0705 {
    public static void STN(int s ,int t, int n){
        int num=s;
        int [][] arr=new int [n][n];
        for (int col=0;col<n;col++){
            for (int row=0;row<n-col;row++){
                arr[row][col]=num;
                num++;
                num=num>t?1:num;
            }
        }
        for (int row=0;row<n;row++){
            for (int col=0;col<n-row;col++){
               System.out.print(arr[row][col]+"\t");
            }
            System.out.println();
        }
    }
    public static void STN2(int s ,int t, int n){
        int num=s;
        int [][] arr=new int [n][n];
        for (int col=n-1;col>=0;col--){
            for (int row=n-1-col;row<n;row++){
                arr[row][col]=num;
                num++;
                num=num>t?1:num;
            }
        }
        for (int row=0;row<n;row++){
            for (int col=0;col<n;col++){
                if (col<n-1-row){
                    System.out.print("\t");
                }else{
                    System.out.print(arr[row][col]+"\t");
                }
            }
            System.out.println();
        }
    }//以上三角矩阵例子


    public static void STN3(int s,int t,int n){
        int num=s;// s=4,t=8,n=9
        int[][] arr=new int[n][n];
        for(int col=n-1;col>=0;col--){
            for (int row=0;row<=col;row++){
                arr[row][col]=num;
                num++;
                num=num>t?1:num;
            }
        }
        for (int row=0;row<n;row++){
            for (int col=0;col<n;col++){
                if (col<row){
                    System.out.print("\t");
                }else{
                    System.out.print(arr[row][col]+"\t");
                }
            }
            System.out.println();
        }
    }// 要求三角矩阵
}